package day12.hmoework20;

/**
 * 士兵类
 */
public class Soldier extends Data implements Defend{
    public Soldier(){}
    public Soldier(String name,int level){
        super(name,level);
    }
    @Override
    public void defend() {
        System.out.println("我是" + this.getLevel() + "级的" +getName() + "我可以抵抗盗贼、猎人和农民等的攻击");
    }
}
